import service from "./index.js";

// 获取页数
export function pageCount(data) {
    return service({
        url: '/admin/student/course/page/count',
        method: 'get',
        params: data
    })
}
// 获取列表数据
export function page(data, page) {
    return service({
        url: '/admin/student/course/page/' + page,
        method: 'get',
        params: data
    })
}
// 获取是否选课
export function getSelect() {
    return service({
        url: '/option/allowStudentSelect',
        method: 'get',
    })
}
// 获取是否打分
export function getGrade() {
    return service({
        url: '/option/allowTeacherGrade',
        method: 'get',
    })
}
// 选课
export function putSelect(data) {
    return service({
        url: '/option/allowStudentSelect',
        method: 'put',
        data: data,
    })
}
// 打分
export function putGrade(data) {
    return service({
        url: '/option/allowTeacherGrade',
        method: 'put',
        data: data,
    })
}
// 获取课程
export function courseAll() {
    return service({
        url: '/admin/course/names',
        method: 'get',
    })
}
// 获取学生
export function studentAll() {
    return service({
        url: '/admin/student/names',
        method: 'get',
    })
}
// 添加
export function studentCourseAdd(data) {
    return service({
        url: '/admin/student/course',
        method: 'post',
        data: data,
    })
}
// 删除
export function mixinDelete(id) {
    return service({
        url: '/admin/student/course/' + id,
        method: 'delete',
    })
}
// 获取详情
export function getStudentCourse(id) {
    return service({
        url: '/admin/student/course/' + id,
        method: 'get'
    })
}
// 修改
export function studentCourseEdit(data) {
    return service({
        url: '/admin/student/course',
        method: 'put',
        data: data
    })
}